#include "serverInfoMessage.h"
#include "mtpProtocol.h"

ServerInfoMessage::ServerInfoMessage(MtpProtocol* packet) : MtpMessage(packet)
{

}

ServerInfoMessage::ServerInfoMessage(MtpMessage* message) : MtpMessage(new MtpProtocol(L"serverInfo",(MtpProtocol*)message->getPacket()))
{

}

ServerInfoMessage::~ServerInfoMessage()
{

}

void ServerInfoMessage::decodeBody()
{
	MtpMessage::decodeBody();
	serverInfo.jsonDeserialize(jsonContent);
}

void ServerInfoMessage::encodeBody()
{
	serverInfo.jsonSerialize();
	jsonContent = serverInfo.jsonStr();
	MtpMessage::encodeBody();
}